<%@page contentType="text/html; charset=utf-8" language="java" %>
<%@page import="biz.UserBiz" %>
<%@page import="bean.User" %>
<html>
	<head>
		<link href="css.css" rel="stylesheet" type="text/css">
		<title>永久删除帐号</title>
		<%
		String action = request.getParameter("action");
		if((action != null) && action.equals("delete")){
			boolean flag = UserBiz.deleteUser(Integer.parseInt(session.getAttribute("uid").toString()),request.getParameter("upass"));
			if(flag){
				session.setAttribute("uid",null);
				response.sendRedirect("index.jsp");
			}else{
				out.print("<script>alert('出错了，请稍后再试！');history.back();</script>");
			}
		}
		%>
	</head>
	<body>
		<jsp:include page="/head.jsp"/>
			<center><fieldset>
			<p class="f_title">删除iWiki帐号</p>
			<div class="disc">永久删除帐号后，您将不能使用该帐号登录iWiki。<br/>在下方输入密码以确认删除该帐号。</div>
			<br/>
			<form method="post" action="deleteuser.jsp?action=delete">
				<label for="upass">密码：</label><span><input type="password" name="upass" class="input" style="width:180px;"></span>
				<input type="submit" value="确定" style="width:60px" class="button"/>
				<input type="button" value="取消" onClick="javascript:history.back()" style="width:60px" class="button"/>	
			</form>
			</fieldset></center>
		<jsp:include page="/copyright.html"/>
	</body>
</html>